<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>信息管理-夜读书</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="加入夜读书文化联盟，共同打造文化的产业盟国，让阅读无处不在。">
    <meta name="keywords" content="夜读书文化联盟，读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/hangye.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    {{-- umeditor --}}
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/ueditor.config.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/ueditor.all.js')}}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/lang/zh-cn/zh-cn.js')}}"></script>
    {{-- umeditor end--}}
</head>
<body>
    @include('hangye.include.uheader')
    <div id="detailc">
        @include('hangye.include.aside')
        <article class="main-article">
        <form name="form" class="form-horizontal" role="form" method="post" action="" enctype="multipart/form-data">
        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
        <div class="">
            <label for="biaoti" class="control-label">活动标题*：</label>      
            <input type="text" class="form-control" name="biaoti" id="biaoti" value="">      
        </div>
        <div class="">
            <label for="jieshao" class="control-label">介绍*:</label>
            <script type="text/plain" id="jieshao" name="jieshao" style="width:100%;"></script>
        </div>
        <label>添加需要赠送的书籍</label>
        <span class="" style="display:block;margin-bottom:10px;">请输入图书在夜读书的页面地址,如 http://www.yedushu.com/info/12049 <a href="http://www.yedushu.com" target="_blank">去夜读书搜索</a></span>
        <div style="padding-bottom: 10px;width: 550px;">
            <input type="text" class="form-control" name="zengshulist" id="zengshulist" value="">
        </div>
        <div>
            <button type="button" id="okbutton" class="btn btn-success" style="float:right">发布</button>
        </div>
        </form>
        </article>
    </div>
    <div style="clear:both;"></div>
    @include('hangye.include.footer')
<script type="text/javascript">
    //实例化编辑器
    var ueneirongjianjie = UE.getEditor('jieshao',{
        wordCount: true, //开启字数统计
        elementPathEnabled: false,//是否启用元素路径，默认是显示
        maximumWords: 3000,       //允许的最大字符数
        initialContent: '',    //初始化编辑器的内容,也可以通过textarea/script给值，看官网例子
        //autoClearinitialContent: true, //是否自动清除编辑器初始内容，注意：如果focus属性设置为true,这个也为真，那么编辑器一上来就会触发导致初始化的内容看不到了
        pasteplain: true,  //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
        enableContextMenu: false, //关闭右键菜单功能
        //imageUrlPrefix: "http://localhost:4176", /* 图片访问路径前缀 */
        //imagePathFormat: "/UploadFiles/{yyyy}{mm}{dd}/{time}{rand:6}",/* 上传保存路径,可以自定义保存路径和文件名格式 */
        //urlTarget: "Email",
        initialFrameWidth: 860, //初始化宽度
        initialFrameHeight: 300, //初始化高度
        autoHeightEnabled: false, //关闭高度自适应
        enableAutoSave: false //禁止自动保存
        ,toolbars: [[
            'forecolor', //字体颜色
           'backcolor', //背景色
           'fontfamily', //字体
           'fontsize', //字号        
           '|',  
           'bold', //加粗
           'italic', //斜体
           'underline', //下划线
           'strikethrough', //删除线
           '|',
           'justifyleft', //居左对齐
           'justifycenter', //居中对齐
           'horizontal', //分隔线
           '|',
          'link', //超链接
          'unlink' //取消链接
        ]]
    });

$(document).ready(function(){
    $("#okbutton").click(function(){
        if($.trim($("#biaoti").val())=="")
        {
            alert("请输入标题。");
            $("#biaoti").focus();
        }
        else if(!UE.getEditor('jieshao').hasContents())
        {
            alert("请输入介绍。");
            UE.getEditor('jieshao').focus();
        }
        else if((UE.getEditor('jieshao').getContentTxt()).length>3000)
        {
            alert("活动介绍不要超过3000个字符。");
            UE.getEditor('jieshao').focus();
        }
        else if($.trim($("#zengshulist").val())=="")
        {
            alert("请输入要赠送的图书。");
            $("#zengshulist").focus();
        }
        else
        {
            form.submit();
        }
    });
});
</script>
</body>
</html>